﻿@using BonjourQuotation.UI.Models.PartialModel
@model QuotationHotelGridViewModel
@{
    Layout = null;
    //bool functBtn = true;
    //functBtn = !User.IsInRole("accountant");
}


<div id="VendorContractHotel" style="display:none;">
</div>
@using (Ajax.BeginForm("UpdateQuotationHotels", "Quotation", new AjaxOptions() { HttpMethod = "Post", OnComplete = "QuotaValidateComplete", UpdateTargetId = "tabHotels", InsertionMode = InsertionMode.Replace }, new { enctype = "multipart/form-data", id = "QuotaHotelGridForm" }))
{
    @Html.HiddenFor(model => model.QuotaHotelIsNewLine)
    @Html.HiddenFor(model => model.QuotaHotelInsertRow)
    @Html.HiddenFor(model => model.QuotaHotelIsInsert)
    @Html.HiddenFor(model => model.QuotaHotelErrorCode)
    @Html.HiddenFor(model => model.QuotaHotelErrorMessage)
   <table class="table table-bordered table-hover">
    <th>#</th>
    <th>Date</th>
    <th>Hotels</th>
    <th>M</th>
    <th>Rooms</th>
    <th>Tax %</th>
    <th>T/N</th>
    <th>g</th>
    <th>f</th>
    <th>d</th>
    <th>R+T</th>
    <th>RT/2</th>
    <th>Brk</th>
    @*<th>T</th>*@
    <th>g</th>
    @*<th>f</th>*@
    <th>#N</th>
    <th>Lg</th>
    <th>RPP</th>
    <th>SS</th>
    <th>Curr</th>
    @if (Model.QuotaHotelRemoveBtnView && !(Model.QuotaHotelConfirmed))
    {
        <th>del</th>
    }
       <tbody>
           @if (Model.Rows.Count > 0)
           {
               @Html.HiddenFor(model => model.Rows[0].QuotaID)
           }
           @for (int ind = 0; ind < Model.Rows.Count; ind++)
           {

               <tr class="@(@Model.Rows[ind].CurrencyHotel == "CA" ? "trCurrencyCad" : "") @(@ind % 2 == 0 ? "trRowBackground1" : "")">
                   <td>@Html.LabelForModel(Model.Rows[ind].LineNo, new { @class = "Label_QuotaGrd" })</td>@Html.HiddenFor(model => model.Rows[ind].LineNo)
                   @if (Model.Rows[ind].LineDate.Contains("Fri") || Model.Rows[ind].LineDate.Contains("Sat"))
                   {
                       <td>
                           @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date QuotaDatesFriSat Label_QuotaGrd" })
                           @Html.HiddenFor(model => model.Rows[ind].LineDate)
                       </td>
                   }
                   else
                   {
                       <td>
                           @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date Label_QuotaGrd" })
                           @Html.HiddenFor(model => model.Rows[ind].LineDate)
                       </td>
                   }
                   @if (Model.Rows[ind].HotelM == false)
                   {
                       <td>
                           @Html.TextBoxFor(model => Model.Rows[ind].HotelDesc, new { @class = "QuotaTxtComplete table_inputs_320 table_inputs_WithoutBox HotelDetTab", @tabindex = "1" })
                           @Html.HiddenFor(model => Model.Rows[ind].VendorID, new { @class = "HotelID" })
                       </td>
                   }
                   else
                   {
                       <td>
                           @Html.TextBoxFor(model => Model.Rows[ind].HotelDesc, new { @class = "table_inputs_320 table_inputs_WithoutBox HotelDetTab" })
                           @Html.HiddenFor(model => Model.Rows[ind].VendorID, new { @class = "HotelID"})
                       </td>
                   }
                   <td>
                       @Html.CheckBoxFor(model => Model.Rows[ind].HotelM, new { @class = "QuotaRemTxtComplete HotelDetTab HotelMFlag", @tabindex = "-1" })
                   </td>
                   <td>
                       @Html.TextBoxFor(model => Model.Rows[ind].Room, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_60 room table_inputs_WithoutBox HotelDetTab QuotaMoneyTxb" })
                   </td>
                   <td>@Html.TextBoxFor(model => Model.Rows[ind].tax, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_50 Tax HotelDetTab table_inputs_WithoutBox QuotaMoneyTxb" })</td>
                   <td>@Html.TextBoxFor(model => Model.Rows[ind].OccTax, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_50 Occtax HotelDetTab table_inputs_WithoutBox QuotaMoneyTxb" })</td>
                   <td>@Html.CheckBoxFor(model => Model.Rows[ind].GuideFlag, new { @class = "HotelDetTab" })</td>
                   <td>@Html.CheckBoxFor(model => Model.Rows[ind].FreeFlag, new { @class = "HotelDetTab" })</td>
                   <td>@Html.CheckBoxFor(model => Model.Rows[ind].DriverFlag, new { @class = "HotelDetTab" })</td>
                   <td>@Html.LabelForModel(Model.Rows[ind].RoomTax, new { @class = " table_inputs Label_QuotaGrd" })</td>
                   <td>@Html.LabelForModel(Model.Rows[ind].RoomTax2, new { @class = "table_inputs Label_QuotaGrd" })</td>
                   <td>@Html.TextBoxFor(model => Model.Rows[ind].Breakfast, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_50 Brfast HotelDetTab table_inputs_WithoutBox QuotaMoneyTxb" })</td>
                   @*<td>@Html.TextBoxFor(model => Model.Rows[ind].BrfType, new { @class = "table_inputs_small HotelDetTab" })</td>*@
                   <td>@Html.CheckBoxFor(model => Model.Rows[ind].BGuideFlag, new { @class = "HotelDetTab" })</td>
                   @*<td>@Html.CheckBoxFor(model => Model.Rows[ind].BFreeFlag, new { @class = "HotelDetTab" })</td>*@
                   <td>@Html.TextBoxFor(model => Model.Rows[ind].Nights, new { @class = "QuotaOnlyDigits QuotaTextBx table_inputs_40 HotelNights HotelDetTab table_inputs_WithoutBox", @style = "color:red; font-weight:700; " })</td>
                   <td>@Html.TextBoxFor(model => Model.Rows[ind].Luggage, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_50 Lugg HotelDetTab table_inputs_WithoutBox QuotaMoneyTxb" })</td>
                   <td>@Html.LabelForModel(Model.Rows[ind].RoomPP, new { @class = "table_inputs_50 Label_QuotaGrd" })</td>
                   <td>@Html.LabelForModel(Model.Rows[ind].SingleSupp, new { @class = "table_inputs_50 Label_QuotaGrd" })</td>
                   @if(Model.Rows[ind].CurrencyHotel == "CA")
                   {
                        <td>@Html.TextBoxFor(model => Model.Rows[ind].CurrencyHotel, new { @class = "QuotaOnlyCurrency QuotaTextBx CurrencyHotel table_inputs table_inputs_WithoutBox HotelDetTab QuotationCurrCAD" })</td>
                   }
                   else
                   {
                        <td>@Html.TextBoxFor(model => Model.Rows[ind].CurrencyHotel, new { @class = "QuotaOnlyCurrency QuotaTextBx CurrencyHotel table_inputs table_inputs_WithoutBox HotelDetTab" })</td>
                   }
                   @if (Model.QuotaHotelRemoveBtnView && !(Model.QuotaHotelConfirmed))
                   {
                       <td id="tddel"><button class="btndel" type="button" style="padding:0px; " onclick="RemoveHotel('@Model.Rows[ind].HotelID','@Model.Rows[ind].LineNo')"></button></td>
                   }
               </tr>
           }
       </tbody>
        </table>


    if (Model.QuotaHotelInsertBtnView && !(Model.QuotaHotelConfirmed))
    {
        <input type="number" min="1" class="QuotaTabInsertTxb" id="HotelInsertLine" value="1" />
        <button class="btn14" type="button" onclick="InsertLineHotelGrid()">Insert</button>
    }
    <div class="pull-right QuotaTabUpdateDivBtn">
        @if (Model.QuotaHotelNewLineBtnView && !(Model.QuotaHotelConfirmed))
        { 
            <button class="btn14" type="button" onclick="HotelNewLine()">New Line</button>
        }
        @if (Model.QuotaHotelUpdateBtnView && !(Model.QuotaHotelConfirmed))
        { 
            <button class="btn14" id="HotelTabUpdate" type="button">Validate</button>
        }
    </div>
    <div class=" col-lg-2 withoutPadding pull-right" style="width: 9% !important; margin-right:8px; margin-top:-6px;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize ColorRedBold" style="width: 30px !important;">@Html.LabelFor(model => model.NightSum)</span>
            @Html.TextBoxFor(model => Model.NightSum, new { @class = "table_inputs_40 form-control SumControlsFSize ColorRedBold", @readOnly = true })
        </div>
    </div>

<div class="row form-row">
    
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important; margin-left:32px;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.GuideSum)</span>
            @Html.LabelForModel(Model.GuideSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.FreeSum)</span>
            @Html.LabelForModel(Model.FreeSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.DriverSum)</span>
            @Html.LabelForModel(Model.DriverSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.BreakfSum)</span>
            @Html.LabelForModel(Model.BreakfSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 12% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.RppSum)</span>
            @Html.LabelForModel(Model.RppSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding" style="width: 12% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.LgSum)</span>
            @Html.LabelForModel(Model.LgSum, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    
    <div class=" col-lg-2 withoutPadding" style="width: 12% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SsSum)</span>
            @Html.LabelForModel(Model.SsSum, new { @class = "form-control SumControlsFSize" })

        </div>
    </div>
</div>


}

        
  


